package com.mxx.springaction.proxy.activeProxy;

import com.mxx.springaction.proxy.staticProxy.StudentProxy;
import sun.misc.ProxyGenerator;

import java.lang.reflect.Proxy;

public class MainClass {
    public static void main(String[] args) {
        Student mxx = new Student("mxx");
        Student proxy = (Student) Proxy.newProxyInstance(mxx.getClass().getClassLoader(), new Class[]{Person.class},
                new ActiveProxy<Student>(mxx));
        proxy.giveWork();
        ProxyGenerator.generateProxyClass("$Proxy0", Student.class.getInterfaces());
    }
}
